#include <iostream>
#include <stdio.h>

int main()
{
    const char* str = "124";
    char buffer[10];
    // 1、将字符串输出到buffer中
    sprintf(buffer, "%s", str);
    // 2、将字符串拼接
    const char* str1 = "567";
    sprintf(buffer, "%s%s", str, str1);
    //std::cout << buffer << std::endl;
    std::cout << buffer << std::endl;
    snprintf(buffer, 200, "%s%s", str, str1);
    std::cout << buffer << std::endl;
    return 0;
}
